Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DisableNativeToolsetInstalls check to tools.ps1/.sh #4133

Merged
merged 12 commits into from
Oct 21, 2019

Conversation

sunandabalu
Copy link
Member

@sunandabalu sunandabalu commented Oct 16, 2019

  • Moving the DisableNativeToolsetInstalls check into tools.ps1/.sh from build.ps1/.sh
  • Update post-build SDL scripts to set the "DisableNativeToolsetInstalls" variable.

Test Build - https://dev.azure.com/dnceng/internal/_build/results?buildId=390365&view=results

@sunandabalu sunandabalu requested a review from chcosta October 16, 2019 20:33
eng/common/tools.ps1 Outdated Show resolved Hide resolved
Copy link
Member

@chcosta chcosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a link to the build which validates your changes fix the wpf build?

eng/common/tools.ps1 Outdated Show resolved Hide resolved
@sunandabalu
Copy link
Member Author

sunandabalu commented Oct 17, 2019

Do you have a link to the build which validates your changes fix the wpf build?

Test Build with the change for WinForms
https://dev.azure.com/dnceng/internal/_build/results?buildId=392397&view=results

eng/common/tools.ps1 Outdated Show resolved Hide resolved
eng/common/tools.ps1 Outdated Show resolved Hide resolved
eng/common/tools.ps1 Outdated Show resolved Hide resolved
@@ -4,6 +4,7 @@

# CI mode - set to true on CI server for PR validation build or official build.
ci=${ci:-false}
DisableConfigureToolsetImport=${DisableConfigureToolsetImport:-null}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format for variable is inconsistent with the rest of the file. Should be something like disable_configure_toolset_import

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's true, and it's probably too late to fix. Fortunately, it's not too late to update yours to align with the general conventions used in this file.

Copy link
Member

@chcosta chcosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assuming this is validated on Windows and Linux, this looks good to me.

@sunandabalu sunandabalu merged commit 7a82f9a into master Oct 21, 2019
@sunandabalu sunandabalu deleted the PostBuildDisableNativeToolsetInstalls branch October 21, 2019 23:41
@@ -418,6 +420,9 @@ function GetSdkTaskProject([string]$taskName) {
}

function InitializeNativeTools() {
if ($env:DisableNativeToolsetInstalls) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this broke the disabling mechanism of the native toolsets. cc @chcosta, @jashook @trylek

Copy link
Member

@ViktorHofer ViktorHofer Oct 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be just $null -eq $DisableNativeToolsetInstalls.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With strict mode on, it should probably be something like

if (-Not( Test-Path variable:DisableNativetoolsetInstalls))

@sunandabalu , can you take a look?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like Viktor already has a PR. Thanks @ViktorHofer

@@ -252,6 +253,9 @@ function GetNuGetPackageCachePath {
}

function InitializeNativeTools() {
if [[ -z "${DisableNativeToolsetInstalls:-}" ]]; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunandabalu , is this supposed to be -n instead of -z?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-z to check if its empty, if empty then exit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to exit if it's not empty?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For that matter, the fix viktor made seems off as well. What's the intent of "disable" native toolset installs? I interpret your implementation as, if this value is empty, then do nothing, if it is not defined, then skip native tools installs. Something seems broken here, but perhaps the logic is getting jumbled in my head.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants